package com.kotlin.dongdong.demo.ui.login

import com.kotlin.dongdong.framework.mvp.BaseModel
import com.kotlin.dongdong.framework.mvp.BasePresenter
import com.kotlin.dongdong.framework.mvp.BaseView
import com.kotlin.dongdong.framework.http.resultentity.BackResult
import com.kotlin.dongdong.framework.http.resultentity.BookEntity
import com.kotlin.dongdong.framework.http.resultentity.loginEntity
import io.reactivex.Observable

/**
 * Created by dongdongzheng on 2018/2/12.
 */
interface LoginContract {
    interface Model : BaseModel {

        fun login(phone: String, pwd: String): Observable<BackResult<loginEntity>>

        fun getBook(): Observable<BookEntity>
    }


    interface View : BaseView {
        fun onResultError(error: String)

        fun loginRexult(entity: BackResult<loginEntity>)

        fun getBookResult(entity: BookEntity)

    }

    abstract class Presenter : BasePresenter<Model, View>() {
        abstract fun login(phone: String, pwd: String)
        abstract fun getBook()
    }
}